﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="SharingCenter.Web.Admin.Events.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    活动管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManagerProxy runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Admin/Events/Event.js" />
        </Scripts>
    </asp:ScriptManagerProxy>
    <myuc:GenericTabs ID="GenericTabs1" runat="server" Section="AdminEvents" SelectedItem="1" />
    <h2 class="w5">
        活动管理</h2>
    <asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1" DataKeyNames="EventId">
     <ItemSeparatorTemplate>
                <tr>
                    <td colspan="10"><div class="hr1"></div></td>
                </tr>
            </ItemSeparatorTemplate>
        <ItemTemplate>
            <tr class="eventitem">
                <td>
                    <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("Title") %>' NavigateUrl='<%#Eval("EventId", "~/Mod/Events/?id={0}") %>' />
                    <asp:Label ID="CategoryLabel" CssClass="litetext" runat="server" Text='<%# Eval("Category", "({0})") %>' />
                </td>
                <td>
                    <asp:Label ID="StartDateLabel" runat="server" Text='<%# Eval("StartDate", "{0:yyyy年M月d日 HH:mm}") %>' />
                </td>
                <td>
                        <asp:Label ID="EndDateLabel" runat="server" Text='<%# Eval("EndDate", "{0:yyyy年M月d日 HH:mm}") %>' />
                    </td>
                <td>
                    <cc:avatarimage cssclass="useravatar" avatartype="Tiny" alternatetext="" width="16"
                        userid='<%#Eval("CreatorUserId") %>' runat="server" />
                    <cc:nicknamelink runat="server" userid='<%#Eval("CreatorUserId") %>' />
                </td>
                <td>
                    <asp:Label ID="Sc_EventRequestsLabel" runat="server" Text='<%# Eval("TotalParticipants")+"/"+((int)Eval("MaxParticipants")>0?Eval("MaxParticipants"):"无限制") %>' />
                </td>
                <td>
                        <asp:HyperLink CssClass="deleteeventbutton pointer" runat="server" ImageUrl="~/Content/images/icons/cross1.png" ToolTip="删除" eid='<%#Eval("EventId") %>'></asp:HyperLink>
                        <asp:HyperLink CssClass="canceleventhotbutton hotbutton pointer" runat="server" ImageUrl="~/Content/images/icons/fire_on.png" ToolTip="取消热" eid='<%#Eval("EventId") %>' Visible='<%#Eval("IsHot") %>'></asp:HyperLink>
                        <asp:HyperLink CssClass="seteventhotbutton hotbutton pointer" runat="server" ImageUrl="~/Content/images/icons/fire_off.png" ToolTip="设置为热" eid='<%#Eval("EventId") %>' Visible='<%#!Convert.ToBoolean(Eval("IsHot")) %>'></asp:HyperLink>
                        <asp:HyperLink CssClass="canceleventrecbutton recbutton pointer" runat="server" ImageUrl="~/Content/images/icons/star_on.png" ToolTip="取消精华" eid='<%#Eval("EventId") %>' Visible='<%#Eval("IsRecommended") %>'></asp:HyperLink>
                        <asp:HyperLink CssClass="seteventrecbutton recbutton pointer" runat="server" ImageUrl="~/Content/images/icons/star_off.png" ToolTip="设置为精华" eid='<%#Eval("EventId") %>' Visible='<%#!Convert.ToBoolean(Eval("IsRecommended")) %>'></asp:HyperLink>
                    </td>
            </tr>
        </ItemTemplate>
        <EmptyDataTemplate>
            <myuc:messagebox runat="server" messagetype="Generic" text="目前没有任何活动。" />
        </EmptyDataTemplate>
        <LayoutTemplate>
            <table id="itemPlaceholderContainer" runat="server" border="0" class="tb-full">
                <tr>
                    <th>
                        活动名称
                    </th>
                    <th>
                        开始日期
                    </th>
                     <th>
                            结束日期
                        </th>
                    <th>
                        发起人
                    </th>
                    <th>
                        参与/上限
                    </th>
                    <th></th>
                </tr>
                <tr id="itemPlaceholder" runat="server">
                </tr>
            </table>
            <div class="actionarea textfar">
                <asp:DataPager ID="DataPager1" runat="server" PageSize="20">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="首页" ButtonCssClass="pager-f1 "
                            ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                        <asp:NumericPagerField ButtonType="Link" NumericButtonCssClass="pager-n1 " CurrentPageLabelCssClass="pager-c" />
                        <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" ShowNextPageButton="False"
                            ButtonCssClass="pager-l1 " ShowPreviousPageButton="False" LastPageText="末页" />
                    </Fields>
                </asp:DataPager>
            </div>
        </LayoutTemplate>
    </asp:ListView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SharingCenter.Web.Classes.scDataContext"
        OrderBy="StartDate" TableName="Sc_Events">
        <%--<WhereParameters>
            <asp:Parameter Name="StartDate" Type="DateTime" />
        </WhereParameters>--%>
    </asp:LinqDataSource>
</asp:Content>
